package com.cl.short_video_java.web.client.video;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cl.short_video_java.common.Result;
import com.cl.short_video_java.dto.VideoDto;
import com.cl.short_video_java.pojo.VideoVideo;
import com.cl.short_video_java.service.VideoVideoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author 付
 * @Date 2024-11-29 11:50
 * @Version 1.0
 * @description 热播的controller
 * @since 1.0
 */

@RestController
@RequestMapping("/client/hit")
public class HitController {

	private VideoVideoService videoService;

	public HitController(VideoVideoService videoService) {
		this.videoService = videoService;
	}

	/**
	 * 获取热播的分页数据
	 *
	 * @param pageNum
	 * @return
	 */
	@GetMapping("/page")
	public Result hitPage(@RequestParam("pageNum") Integer pageNum) {
		Page<VideoVideo> page = videoService.hit(pageNum);
		return Result.success(page);
	}

}
